#!/bin/bash

#variable:_S3_HOST__

S3_HOST="192.168.1.1:9000"
S3_SECRET_KEY="miniotestpass"
S3_ACCESS_KEY="miniotest"
ALERTMANAGER_URL="192.168.1.2:9000"

sed -i "s#__S3_SECRET_KEY__#${S3_SECRET_KEY}#g" loki-sys/configmap.yaml
sed -i "s#__S3_ACCESS_KEY__#${S3_ACCESS_KEY}#g" loki-sys/configmap.yaml
sed -i "s#ALERTMANAGER_URL#${ALERTMANAGER_URL}#g" loki-sys/configmap.yaml

kubectl apply -f loki-sys/configmap.yaml
kubectl apply -f loki-sys/loki.yaml
kubectl apply -f loki-sys/service.yaml